package com.zebra.remoting.config;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class ONNUMTORAmessage extends ZebraBaseMessage<ONNUMTORAmessage> {

    private int serverId;
    private int serverType;
    private long onlineNumber;

    @Override
    public void write(ByteBuf b) {
        writeInt(b, this.serverId);
        writeInt(b, this.serverType);
        writeLong(b, this.onlineNumber);
    }

    @Override
    public ONNUMTORAmessage read(ByteBuf b) {
        ONNUMTORAmessage message = new ONNUMTORAmessage();
        message.setServerId(readInt(b));
        message.setServerType(readInt(b));
        message.setOnlineNumber(readLong(b));
        return message;
    }
}
